/*
 *
 * 自機と敵の当たり判定
 *
 * 戻り値 { 0 : 当たっていない、1 : 当たっている }
 *
 */
int
hitcheck(int num)
	{
	int	a,b,c,p,q,r;

	if ( ship.x > enemy[num].x )
		{
		a = ship.x - enemy[num].x;
		}
	else
		{
		a = enemy[num].x - ship.x;
		}
	if ( ship.y > enemy[num].y )
		{
		b = ship.y - enemy[num].y;
		}
	else
		{
		b = enemy[num].y - ship.y;
		}
	if ( ship.z > enemy[num].z )
		{
		c = ship.z - enemy[num].z;
		}
	else
		{
		c = enemy[num].z - ship.z;
		}

	p = ship.xsize + enemy[num].xsize;
	q = ship.ysize + enemy[num].ysize;
	r = ship.zsize + enemy[num].zsize;

	if ( a < p && b < q && c < r ) return 1;

	return	0;
	}

/*
 *
 * 敵弾と自機との当たり判定
 *
 * 戻り値 { 0 : 当たっていない、1 : 当たっている }
 *
 */
int
emslhitcheck(int m)
	{
	int	a,b,c,p,q,r;

	if ( ship.x > emsl[m].x )
		{
		a = ship.x - emsl[m].x;
		}
	else
		{
		a = emsl[m].x - ship.x;
		}
	if ( ship.y > emsl[m].y )
		{
		b = ship.y - emsl[m].y;
		}
	else
		{
		b = emsl[m].y - ship.y;
		}
	if ( ship.z > emsl[m].z )
		{
		c = ship.z - emsl[m].z;
		}
	else
		{
		c = emsl[m].z - ship.z;
		}

	p = ship.xsize + emsl[m].xsize;
	q = ship.ysize + emsl[m].ysize;
	r = ship.zsize + emsl[m].zsize;

	if ( a < p && b < q && c < r ) return 1;

	return	0;
	}

